1. Field of the Invention
The present invention relates to the design of platform-independent virtual machines within computer systems. More specifically, the present invention relates to a method and an apparatus for performing proximity-based addressing to support in-place execution in platform-independent virtual machines.
2. Related Art
Dramatic advances in computer technology presently make it possible to integrate a significant amount of computing power into pocket-sized computing devices, such as cell phones and personal organizers. In order to enable these devices to run a wide variety of applications, developers have begun to incorporate platform-independent virtual machines (such as the JAVA VIRTUAL MACHINE™ developed by SUN Microsystems, Inc. of Santa Clara, Calif.) into these computing devices. This enables these computing devices to execute platform-independent bytecodes, which can be easily distributed to a large number of different computing platforms.
In particular, the Java 2 Platform, Micro Edition (J2ME™) has become very popular in the wireless device space. Many key players in the wireless device industry have recently started shipping J2ME-enabled devices in high volume. It has been estimated that 60-80 million J2ME-enabled mobile phones were shipped in 2002, and the total number of J2ME devices shipped in 2003 is likely to exceed 200 million. In spite of the success of the J2ME platform, significant challenges for JAVA™ technology remain in the small device space.
One area that is becoming a big bottleneck for serious J2ME application development is—not surprisingly—application size. With the deployment of more significant J2ME applications in mobile devices, J2ME application downloads consume an increasingly larger amount of wireless network bandwidth. Also, the runtime dynamic memory costs and application startup costs associated with anything but very small J2ME applications are still excessive for most mass-market consumer devices, as well as for serious mobile systems software development in the Java programming language.
One of the most promising approaches reducing the memory usage and application startup costs in platform-independent virtual machines is a technique known as “in-place execution.” In a Java Virtual Machine (JVM) that supports pure in-place execution, the standard Java class file format is replaced with a representation that can be used directly as runtime structures for the virtual machine, without the conventional, costly class loading process. In this representation, static data structures, such as classes, method tables, field tables, exception handlers, symbols, constants and byte codes, are never actually loaded into the virtual machine, but are instead accessed directly from the static representation. In mobile devices, where the static representation can be kept in cheap flash or read-only memory, this can imply dramatic RAM consumption savings; up to 5-10× in common situations. The static size of applications can also be significantly smaller than with regular Java class files or JAR files, without any loss of symbolic information or dynamic linkability of Java applications.
Unfortunately, in-place execution has a number of disadvantages when it comes to execution speed. Since in-place executable code is immutable, various commonly used runtime optimizations that depend on the ability to modify bytecodes at runtime cannot be used. Also, since in-place executable files are intended to be easily relocatable in memory, all references in such files must be offsets rather than pointers. This introduces an additional level of indirection at runtime, which slows down execution speed.
Additionally, since in-place executable files are generally intended to be applicable to a broad number of virtual machine implementations, they cannot be customized for particular virtual machine implementations like the run-time data structures that are used in conventional virtual machines.
Because of these problems, in-place execution has not been widely used in platform-independent virtual machines, even though such technology would otherwise be ideal for mobile phones and other target devices.
Hence, what is needed is a method and an apparatus that facilitates efficiently performing in-place execution in platform-independent virtual machines.